#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from django.conf import settings
from cupblog.config.server import BLOGS

__author__ = 'lihaoquan'


#设置项目template的所在路径
def set_template_dir(*d):
    settings.TEMPLATE_DIRS = (
        os.path.join(os.path.dirname(__file__), *d),
    )
    print settings.TEMPLATE_DIRS


def get_themes():
    directory = os.path.join(os.path.dirname(__file__), 'themes')
    return os.listdir(directory)

def get_current_blog(request):
    host = request.get_host()
    print 'current host:'+host
    return BLOGS.get(host)